<template>
	<view>
		<view class="personal_box">
			<view class="hand">
				<view class="ti_01">修改登录密码</view>
			</view>
			<view class="personal_list">
				<view class="title">原密码:</view>			
				<input type="text" value="" placeholder="请输入原登录密码" v-model="pwd1"/>
			</view>
			<view class="personal_list">
				<view class="title">新密码:</view>			
				<input type="text" value="" placeholder="请输入新登录密码" v-model="pwd2"/>
			</view>
			
			<view class="personal_list">
				<view class="title">新密码:</view>			
				<input type="text" value="" placeholder="请再输入新登录密码" v-model="pwd3"/>
				
			</view>
			
			<view class="confirm02" @tap="go()">确认修改</view>
		
		</view>
		
	<!-- 	<view class="personal_box">
			<view class="hand">
				<view class="ti_01">修改支付密码</view>
			</view>
			<view class="personal_list">
				<view class="title">原密码:</view>			
				<input type="text" value="" placeholder="请输入原支付密码" v-model="pay_pwd"/>
			</view>
			<view class="personal_list">
				<view class="title">新密码:</view>			
				<input type="text" value="" placeholder="请输入新支付密码" v-model="pay_pwd2"/>
			</view>
			
			<view class="personal_list">
				<view class="title">新密码:</view>			
				<input type="text" value="" placeholder="请再输入新支付密码" v-model="pay_pwd3"/>
				
			</view>
			
			<view class="confirm02" @tap="payPasswordChange()">确认修改</view>
		
		</view> -->
	</view>
</template>

<script>
	
	export default {
	data() {
		return {
			pwd1:'',
			pwd2:'',
			pwd3:'',
			
			pay_pwd:'',
			pay_pwd2:'',
			pay_pwd3:'',
		};
	},
	onLoad(){
		let me = this;
		//me.api.autoTitle(me.lang.user.repass);		
	},
	methods: {
		go() {
			var that = this;
			if(!that.pwd1 || !that.pwd2 || !that.pwd3)
			{
				that.Msg.Fail('请输入(登录密码)完整信息');
				return
			}
			if(!that.pwd2 != !that.pwd3)
			{
				that.Msg.Fail('2次登录密码不一致');
				return
			}
			//console.log(that.data)
			that.Net._get('upPwd',{pwd1:that.pwd1,pwd2:that.pwd2,pwd3:that.pwd3},(res)=>{
				if(res.code ==1){
					that.Msg.Success('修改成功',(res)=>{
						uni.navigateBack()
					})
				}
			});	
		},
		payPasswordChange() {
			var that = this;
			if(!that.pay_pwd || !that.pay_pwd2 || !that.pay_pwd3)
			{
				that.Msg.Fail('请输入(支付密码)完整信息');
				return
			}
			if(!that.pay_pwd2 != !that.pay_pwd3)
			{
				that.Msg.Fail('2次支付密码不一致');
				return
			}
			console.log(that.data)
			that.Net._get('upzjPwd',{pwd1:that.pay_pwd,pwd2:that.pay_pwd2,pwd3:that.pay_pwd3},(res)=>{
				if(res.code ==1){
					that.Msg.Success('修改成功',(res)=>{
						uni.navigateBack()
					})
				}
			});	
		},
	}
};
</script>


<style>
	page{
		background-color: #f8f8f8;
	}
	
	.personal_box{
		width: 94%;
		background-color: #fff;
		padding-top: 20px;
		padding-bottom: 40rpx ;
		border-radius: 25rpx;
		margin: 30rpx 3%;
		display: inline-block;
		box-shadow: 0 0 15rpx #d3d3d3;
	}
	.personal_list{
		/* background-color: #fff; */
		width: 90%;
		height: 15vw;
		margin: 0 auto;
		display: flex;
		border-bottom: 1px solid #E5E5E5;
		position: relative;
		
	}
	
	.personal_list .title{
		height: 15vw;
		line-height: 15vw;
		font-size: 14px;
		color: #333;
		margin-right: 10px;
		
	}
	
	.personal_list input{
		height: 15vw;
		line-height: 15vw;
		font-size: 14px;
		color: #333;
		width: calc(100% - 150px);
		overflow: hidden;
		text-overflow:ellipsis;
		white-space: nowrap;
		
	}
	
	
	
	.modify{
		width: 90%;
		height: 40px;
		line-height: 40px;
		font-size: 16px;
		color: #fff;
		text-align: center;
		background:#4d726f;
		border-radius: 50px;
		margin: 0 auto;
		margin-top: 50px;
	}
.hand{
		width: 90%;
		margin: auto;
	}
	.hand .ti_01{
		color: #4d726f;
		font-size: 20px;
	}
</style>
